﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class AudioSettingView : IUIView
{
    public Slider bgm, em;
    public Button back;
    public override void Initinalize()
    {
        back.onClick.AddListener(Return);
        bgm.onValueChanged.AddListener(BGMChange);
        em.onValueChanged.AddListener(EMChange);
    }

    private void BGMChange(float arg0)
    {
        AudioManager.Instance.BgmVolume = arg0;
    }

    private void EMChange(float arg0)
    {
        AudioManager.Instance.SetEMVolume(arg0);
    }

    void Return()
    {
        Hide();
        if (SceneManager.GetActiveScene().name=="GameMain")
        {
            UIManager.Instance.settingPanel.Show();
        }
       
    }
}
